import Vue from "vue";
import Vuex from "vuex";
import auth from "@/utils/auth";

Vue.use(Vuex);

export const store = new Vuex.Store({
  modules: {
    auth,
    theme: {
      state: {
        // 主题取值：
        // 空-默认主题==三厂
        // '7-gpx'==七厂GPX
        // '7-nxt'==七厂NXT
        useCustomTheme: "", // 默认主题
      },
      mutations: {
        setUseCustomTheme(state, value) {
          state.useCustomTheme = value;
        },
      },
      actions: {
        toggleCustomTheme({ commit }, value) {
          commit("setUseCustomTheme", value);
        },
      },
      getters: {
        getUseCustomTheme: (state) => state.useCustomTheme,
      },
    },
  },
});
